<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class SiteRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //'province_code'     => 'required|string',
            //'province_name'     => 'required|string',
            'renter_id'         => 'required|integer',
            'city_code'         => 'required|string',
            'city_name'         => 'required|string',
            'region_code'       => 'required|string',
            'region_name'       => 'required|string',
            'name'              => 'required|string',
            'longitude'         => 'required|string',
            'latitude'           => 'required|string',
            'address'           => 'required|string',
            'bh_start'        => '',
            'bh_end'        => '',
            'imgurl'       => 'required|string',
        ];
    }

    /**
     * @return string[]
     */
    public function messages()
    {
        return [
            //'province_code.required'    => '省代码不能为空',
            //'province_name.required'    => '省名称不能为空',
            'renter_id.required'        => '场租方ID不能为空',
            'city_code.required'        => '市代码不能为空',
            'city_name.required'        => '市名称不能为空',
            'region_code.required'      => '区/县代码不能为空',
            'region_name.required'      => '区/县名称不能为空',
            'name.required'             => '站点名称不能为空',
            'longitude.required'          => '经度不能为空',
            'latitude.required'        => '纬度不能为空',
            'address.required'         => '站点地址不能为空',
            'bh_start.required'        => '营业开始时间不能为空',
            'bh_end.required'          => '营业结束时间不能为空',
            'imgurl.required'      => '站点图片不能为空',

        ];
    }
}
